﻿<%@ Page Title="" Language="C#" ValidateRequest="false" MasterPageFile="~/admincp/admin.Master" AutoEventWireup="true" CodeBehind="NewsAdd.aspx.cs" Inherits="xyw.admincp.NewsAdd" %>
<%@ Register src="Controls/UC_SecondNews.ascx" tagname="UC_SecondNews" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderSecond" runat="server">
    <uc1:UC_SecondNews ID="UC_SecondNews1" runat="server" />

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContents" runat="server">
    <div id="main">
      
      <div class="box">
  <div class="box-header">
    <h1>添加新闻</h1>
  </div>
  
  <div class="box-content">
      
        <p>标题：
            <asp:TextBox ID="txt_Title" runat="server" CssClass="{validate:{required:true, minlength:3}}"></asp:TextBox>
        </p>
      <div class="column-left">
        <p>作者：
            <asp:TextBox ID="txt_Author" runat="server" CssClass="{validate:{required:true, minlength:3}}"></asp:TextBox>
        </p>
        <p>部门：
            <asp:TextBox ID="txt_Department" runat="server" CssClass="{validate:{required:true, minlength:3}}"></asp:TextBox>
        </p>
          </div>
      <div class="column-right">
        <p>分类：
            <asp:DropDownList ID="ddl_Classify" runat="server">
                <asp:ListItem>212</asp:ListItem>
            </asp:DropDownList>
        </p>
        <p>缩略图
            <asp:FileUpload ID="FileUpload1" runat="server" />
        </p>
          </div>
        <p>概述：
            <asp:TextBox ID="txt_Outline" runat="server" TextMode="MultiLine"></asp:TextBox>
        </p>
          <p>
              <script type="text/plain" id="editor"></script>
              <asp:HiddenField ID="hd_newsContent" runat="server" />
          </p>

        <div class="clear"></div>
        
        <div class="action_bar">
            <asp:Button ID="Button1" CssClass="button blue" OnClientClick="return SeContent()" runat="server" Text="保存" OnClick="Button1_Click" />
          <a href="News.aspx" class="button">取消</a>
        </div>
        
      
      
  </div>
</div>
      
      </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderScript" runat="server">
    <script src="ueditor/editor_all_min.js"></script>
    <script src="ueditor/editor_config.js"></script>
    <script>
        var editorOption = {
            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
            toolbars: [[ 'source', '|', 'undo', 'redo', '|', 'forecolor', 'bold', 'italic', 'underline', 'fontfamily', 'fontsize', '|', 'removeformat', 'formatmatch', 'autotypeset',
            'pasteplain', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'link', 'unlink', '|', 'imagenone', 'imageleft', 'imageright',
            'imagecenter', '|', 'insertvideo','insertimage', 'attachment', 'map', '|', 'horizontal', 'spechars', '|',
            ]],
            //focus时自动清空初始化时的内容
            //关闭elementPath
            elementPathEnabled: false,
            initialFrameWidth: "99.9%",
            initialFrameHeight: 10
            //更多其他参数，请参考editor_config.js中的配置项
        };
        var ue = new UE.ui.Editor(editorOption);
        ue.render('editor');
        ue.ready(function () {
            ue.setContent('<%=newsContent%>');
        });
        function SeContent() {
            $("#<%=hd_newsContent.ClientID %>").val(UE.utils.unhtml(ue.getContent()));
            //alert();
            return true;
        }
        </script>
</asp:Content>
